<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Global</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Global</h1>

    




<section>

<header>
    
        <h2></h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

        


<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    

    
</dl>


        
    
    </div>

    

    

    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id="BlockPyInterface"><span class="type-signature"></span>BlockPyInterface<span class="type-signature"></span></h4>




<div class="description">
    An automatically generated file, based on interface.html.An interesting problem in web development is managing HTMLcode in JS files. Rather than embedding string literals andconcatenating them, or some other hackish soluion,we simply convert an HTML file to a JS string. Therefore,relevant edits should be in interface.html instead.The BlockPyInterface global can be seen as a constantrepresentation of the default interface.
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="interface.js.html">interface.js</a>, <a href="interface.js.html#line13">line 13</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="EXTENDED_ERROR_EXPLANATION"><span class="type-signature"></span>EXTENDED_ERROR_EXPLANATION<span class="type-signature"></span></h4>




<div class="description">
    A dictionary of improved explanations for Python errors. These are shown to users
alongside the regular errors to hopefully increase clarity.
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="python_errors.js.html">python_errors.js</a>, <a href="python_errors.js.html#line5">line 5</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id="timerGuard"><span class="type-signature"></span>timerGuard<span class="type-signature"></span></h4>




<div class="description">
    Attempts to update the model for the current code file from the 
text editor. Might be prevented if an update event was already
percolating. Also unhighlights any lines.
</div>







<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="editor.js.html">editor.js</a>, <a href="editor.js.html#line557">line 557</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="cloneNode"><span class="type-signature"></span>cloneNode<span class="signature">(node)</span><span class="type-signature"> &rarr; {Node}</span></h4>

    



<div class="description">
    Deeply clones a node
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>node</code></td>
            

            <td class="type">
            
                
<span class="param-type">Node</span>


            
            </td>

            

            

            <td class="description last">A node to clone</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="main.js.html">main.js</a>, <a href="main.js.html#line25">line 25</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    A clone of the given node and all its children
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Node</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="encodeHTML"><span class="type-signature"></span>encodeHTML<span class="signature">(str)</span><span class="type-signature"> &rarr; {string}</span></h4>

    



<div class="description">
    Encodes some text so that it can be safely written into an HTML box.
This includes replacing special HTML characters (&, <, >, etc.).
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">The text to be converted.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">util.js</a>, <a href="util.js.html#line41">line 41</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The HTML-safe text.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="expandArray"><span class="type-signature"></span>expandArray<span class="signature">(array, addArray, removeArray)</span><span class="type-signature"> &rarr; {Array}</span></h4>

    



<div class="description">
    A helper function for extending an array based
on an "addArray" and "removeArray". Any element
found in removeArray is removed from the first array
and all the elements of addArray are added.
Creates a new array, so is non-destructive.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>array</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">the array to manipulate</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>addArray</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">the elements to add to the array</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>removeArray</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            

            

            <td class="description last">the elements to remove from the array</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="main.js.html">main.js</a>, <a href="main.js.html#line13">line 13</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The modified array
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="indent"><span class="type-signature"></span>indent<span class="signature">(str)</span><span class="type-signature"> &rarr; {String}</span></h4>

    



<div class="description">
    Indents the given string by 4 spaces. This correctly handles multi-line strings.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">The string to be manipulated.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="engine.js.html">engine.js</a>, <a href="engine.js.html#line318">line 318</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The string with four spaces added at the start of every new line.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="indent"><span class="type-signature"></span>indent<span class="signature">(str, numOfIndents, opt_spacesPerIndent<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>

    



<div class="description">
    Indents the given string
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>str</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">The string to be indented.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>numOfIndents</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">The amount of indentations to place at the
    beginning of each line of the string.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>opt_spacesPerIndent</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">Optional.  If specified, this should be
    the number of spaces to be used for each tab that would ordinarily be
    used to indent the text.  These amount of spaces will also be used to
    replace any tab characters that already exist within the string.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">util.js</a>, <a href="util.js.html#line24">line 24</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    The new string with each line beginning with the desired
    amount of indentation.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">string</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="instructor_module"><span class="type-signature"></span>instructor_module<span class="signature">(name)</span><span class="type-signature"></span></h4>

    



<div class="description">
    Skulpt Module for holding the Instructor API.

This module is a little hackish. We need to sit down and reevaluate the best way to
organize it and whether this particular structure is ideal. I suspect it should be
it's own proper JS file.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">The name of the module (should always be 'instructor')</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="engine.js.html">engine.js</a>, <a href="engine.js.html#line332">line 332</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="prettyPrintDateTime"><span class="type-signature"></span>prettyPrintDateTime<span class="signature">(timeString)</span><span class="type-signature"> &rarr; {String}</span></h4>

    



<div class="description">
    Helper function to parse a date/time string and rewrite it as something
more human readable.
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>timeString</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last">the string representation of time ("YYYYMMDD HHMMSS")</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="history.js.html">history.js</a>, <a href="history.js.html#line31">line 31</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    - A human-readable time string.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">String</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="randomInteger"><span class="type-signature"></span>randomInteger<span class="signature">(min, max)</span><span class="type-signature"> &rarr; {number}</span></h4>

    



<div class="description">
    Return a random integer between [`min`, `max`].
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>min</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">The lowest possible integer.</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>max</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            

            

            <td class="description last">The highest possible integer (inclusive).</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="util.js.html">util.js</a>, <a href="util.js.html#line8">line 8</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    A random integer.
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="set_button_loaded"><span class="type-signature"></span>set_button_loaded<span class="signature">(btn)</span><span class="type-signature"></span></h4>

    



<div class="description">
    This is a very simplistic helper function that will transform
a given button into a "Loaded" state (disabled, pressed state, etc.).
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>btn</code></td>
            

            <td class="type">
            
                
<span class="param-type">HTMLElement</span>


            
            </td>

            

            

            <td class="description last">An HTML element to change the text of.</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="corgis.js.html">corgis.js</a>, <a href="corgis.js.html#line129">line 129</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BlockPy.html">BlockPy</a></li><li><a href="BlockPyCorgis.html">BlockPyCorgis</a></li><li><a href="BlockPyDialog.html">BlockPyDialog</a></li><li><a href="BlockPyEditor.html">BlockPyEditor</a></li><li><a href="BlockPyEngine.html">BlockPyEngine</a></li><li><a href="BlockPyEnglish.html">BlockPyEnglish</a></li><li><a href="BlockPyFeedback.html">BlockPyFeedback</a></li><li><a href="BlockPyHistory.html">BlockPyHistory</a></li><li><a href="BlockPyPresentation.html">BlockPyPresentation</a></li><li><a href="BlockPyPrinter.html">BlockPyPrinter</a></li><li><a href="BlockPyServer.html">BlockPyServer</a></li><li><a href="BlockPyToolbar.html">BlockPyToolbar</a></li><li><a href="LocalStorageWrapper.html">LocalStorageWrapper</a></li><li><a href="PythonToBlocks.html">PythonToBlocks</a></li></ul><h3>Global</h3><ul><li><a href="global.html#BlockPyInterface">BlockPyInterface</a></li><li><a href="global.html#cloneNode">cloneNode</a></li><li><a href="global.html#encodeHTML">encodeHTML</a></li><li><a href="global.html#expandArray">expandArray</a></li><li><a href="global.html#EXTENDED_ERROR_EXPLANATION">EXTENDED_ERROR_EXPLANATION</a></li><li><a href="global.html#indent">indent</a></li><li><a href="global.html#instructor_module">instructor_module</a></li><li><a href="global.html#prettyPrintDateTime">prettyPrintDateTime</a></li><li><a href="global.html#randomInteger">randomInteger</a></li><li><a href="global.html#set_button_loaded">set_button_loaded</a></li><li><a href="global.html#timerGuard">timerGuard</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Sun Mar 26 2017 09:45:03 GMT-0400 (Eastern Daylight Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>